import styled, { css } from 'styled-components';
import { HTMLAttributes } from 'react';

export const StyledUserProfileMenu = styled.div
    <HTMLAttributes<HTMLDivElement> & { menuColor?: string }>`
    box-sizing: border-box;
    display: flex;
    position: absolute;
    top: 3rem;
    right: 0;
    flex-direction: column;
    background-color: ${props => props.menuColor};
    border: 1px solid black;
    border-radius: 0.3125rem;
    width: auto;
`;

export const StyledMenuItem = styled.button
    <HTMLAttributes<HTMLButtonElement> & { menuColor?: string; hasBorderTop?: boolean; }>`
    
    box-sizing: border-box;
    margin-top: 0.3125rem;
    margin-bottom: 0.3125rem;
    padding: 0.3125rem 1rem;
    border: none;
    font-size: 1.125rem;
    white-space: nowrap;

    &:hover {
        background-color: #E9ECEF;
    }

    background-color: ${props => props.menuColor};
    ${props =>
        props.hasBorderTop &&
        css`
            border-top: 1px solid black;
        `
    }
`;

export const StyledHorizontalRule = styled.hr<HTMLAttributes<HTMLHRElement>>`
    margin: 0;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    border: none;
    height: 1px;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: black;
    }
`;
